﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace WinForm.Analysis
{
    public partial class Test : Form
    {
        public Test()
        {
            InitializeComponent();
        }

        private void Test_Load(object sender, EventArgs e)
        {
            microChart7.DataPoints = GetRandomDataPoints();
        }

        private List<double> GetRandomDataPoints()
        {
            return GetRandomDataPoints(true);
        }
        private List<double> GetRandomDataPoints(bool allowNegative)
        {
            return GetRandomDataPoints(allowNegative, 12);
        }
        private List<double> GetRandomDataPoints(bool allowNegative, int pointsToCreate)
        {
            List<double> points = new List<double>();
            Random rnd = new Random((int)DateTime.Now.Ticks);
            Random rnd2 = new Random();

            for (int i = 0; i < pointsToCreate; i++)
            {
                points.Add(allowNegative ? ((rnd2.Next(50) > 25 ? 1 : -1) * rnd.Next(100)) : rnd.Next(100));
            }

            return points;
        }

    }
}
